<template>
  <div>新闻详情</div>
</template>

<script setup>
import { onActivated } from 'vue'

// vue3为了拿到路由参数，必须调用useRoute方法
import { useRoute } from 'vue-router'
const route = useRoute()

onActivated(() => {
  // vue2 this.$route.query 拿到
  console.log(route.query)
})
</script>
